<script type="text/javascript" src="module/mod_kecamatan/js/combo.js"></script>

<div id="tiga_ba">
	<div id="tiga_baa">Pindah Data Kecamatan</div>
	<div id="tiga_bab"></div>
	<div class="clear"></div>
</div>
            
<?php
	$id=$_GET['id'];
	$sql="select k.id_kecamatan, k.kecamatan, k.id_kabupaten, kb.id_propinsi from kecamatan k inner join kabupaten kb on k.id_kabupaten = kb.id_kabupaten inner join propinsi p on kb.id_propinsi = p.id_propinsi where k.id_kecamatan = $id";
	$qry=mysql_query($sql);
	$hasil=mysql_fetch_array($qry);
?>
<form action="utama.php?module=mod_kecamatan&act=hapus2" onsubmit="return confirm('Anda yakin akan memindah data ?')" method="post" enctype="multipart/form-data">
	<table style="margin: 10px 15px 10px 15px;">
		<tr>
			<td>Nama Kecamatan</td>
			<td>&nbsp;</td>
			<td>
				<input name="kecamatan" type="text" class="input2" id="kecamatan" maxlength="50" value="<?php echo $hasil['kecamatan']?>" disabled />
				<input name="id" id="id" type="hidden" value="<?php echo $id;?>">
				<span class="red">*</span>
			</td>
		</tr>
		<tr>
			<td><b>Pindah Ke : </b></td>
			<td></td>
			<td></td>
		</tr>
		<tr>
			<td>Provinsi</td>
			<td>&nbsp;</td>
			<td>
				<select name="provinsi" id="provinsi" class="input2">
					<?php
						$provinsi = mysql_query("select * from propinsi where aktif = 'Y' order by propinsi");
						while($p = mysql_fetch_array($provinsi)){
							if($p['id_propinsi'] == $hasil['id_propinsi']){
								$s = "selected";
							}else{
								$s = "";
							}
							echo "<option value='$p[id_propinsi]' $s>$p[propinsi]</option>";
						}
					?>
				</select>
			</td>
		</tr>
		<tr>
			<td>Kabupaten</td>
			<td>&nbsp;</td>
			<td>
				<select name="kabupaten" id="kabupaten" class="input2">
					<?php
						$kabupaten = mysql_query("select * from kabupaten where id_propinsi = '$hasil[id_propinsi]' and aktif = 'Y' order by kabupaten");
						while($k = mysql_fetch_array($kabupaten)){
							if($k['id_kabupaten'] == $hasil['id_kabupaten']){
								$sk = "selected";
							}else{
								$sk = "";
							}
							echo "<option value='$k[id_kabupaten]' $sk>$k[kabupaten]</option>";
						}
					?>
				</select>
				<span class="red">*</span>
			</td>
		</tr>
		<tr>
			<td>Kecamatan</td>
			<td>&nbsp;</td>
			<td>
				<select name="kecamatan2" id="kecamatan2" class="input2">
					<option value=""> - - Pilih Kecamatan - - </option>
					<?php
						$kecamatan = mysql_query("select * from kecamatan where id_kabupaten = '$hasil[id_kabupaten]' and id_kecamatan <> $id order by kecamatan");
						while($k = mysql_fetch_array($kecamatan)){
							echo "<option value='$k[id_kecamatan]'>$k[kecamatan]</option>";
						}
					?>
				</select>
				<span class="red">*</span>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td><input name="submit" type="submit" class="button" value="Proses" /></td>
		</tr>
	</table>
</form>